#import "HarbingerDreamController.h"
        
#import "HarbingerDreamModel.h"
#import "HarbingerDreamCell.h"
#import "Masonry.h"

@interface HarbingerDreamController () <UICollectionViewDataSource, UICollectionViewDelegate>

@property (nonatomic, strong) UICollectionView *dazzleAppleThistleCollectionView;
@property (nonatomic, strong) NSMutableArray *xenialBreezeArr;

@end

@implementation HarbingerDreamController

- (void)viewWillAppear:(BOOL)animated {
    [super viewWillAppear:animated];
}

- (void)viewDidLoad {
    [super viewDidLoad];

    [self serenePlumeInitlyout];
	[self oasisloadData];
}


//: 获取数据模型
- (void)oasisloadData {
	
}

//: 懒加载数据模型数组
- (NSMutableArray *)xenialBreezeArr {
	if (!_xenialBreezeArr) {
		_xenialBreezeArr = [NSMutableArray array];
	}
	return _xenialBreezeArr;
}

//: 初始化页面UI
- (void)serenePlumeInitlyout {
	[self.view addSubview:self.dazzleAppleThistleCollectionView];
	[self.dazzleAppleThistleCollectionView mas_makeConstraints:^(MASConstraintMaker *make) {
		make.edges.equalTo(self.view);
	}];
}


- (UICollectionView *)dazzleAppleThistleCollectionView {
    if (!_dazzleAppleThistleCollectionView) {
        UICollectionViewFlowLayout *flowLayout = [[UICollectionViewFlowLayout alloc] init];
        flowLayout.minimumLineSpacing = 10;
        flowLayout.minimumInteritemSpacing = 10;
        flowLayout.itemSize = CGSizeMake(100, 100);
        flowLayout.scrollDirection = UICollectionViewScrollDirectionVertical;
        
        _dazzleAppleThistleCollectionView = [[UICollectionView alloc] initWithFrame:self.view.bounds collectionViewLayout:flowLayout];
        _dazzleAppleThistleCollectionView.backgroundColor = UIColor.clearColor;
        _dazzleAppleThistleCollectionView.delegate = self;
        _dazzleAppleThistleCollectionView.dataSource = self;
        _dazzleAppleThistleCollectionView.showsHorizontalScrollIndicator = NO;
        _dazzleAppleThistleCollectionView.showsVerticalScrollIndicator = NO;
        [_dazzleAppleThistleCollectionView registerClass:[HarbingerDreamCell class] forCellWithReuseIdentifier:NSStringFromClass([HarbingerDreamCell class])];
    }
    return _dazzleAppleThistleCollectionView;
}

#pragma mark - UICollectionView DataSource
- (NSInteger)collectionView:(UICollectionView *)collectionView numberOfItemsInSection:(NSInteger)section {
    return self.xenialBreezeArr.count;
}

- (UICollectionViewCell *)collectionView:(UICollectionView *)collectionView cellForItemAtIndexPath:(NSIndexPath *)indexPath {
    HarbingerDreamCell *doodle = [collectionView dequeueReusableCellWithReuseIdentifier:NSStringFromClass([HarbingerDreamCell class]) forIndexPath:indexPath];
    return doodle;
}

#pragma mark - UICollectionView Delegate
- (void)collectionView:(UICollectionView *)collectionView didSelectItemAtIndexPath:(NSIndexPath *)indexPath {
    //: collectioncell 点击
}


@end
